#pragma once
#include "winboost_unicode.hpp"

namespace winboost {
   namespace debug {

template <typename _Policy>
class trace
{
public:
   template<typename T>
   u_stringstream& operator << (T arg)
   {
      m_trace << arg;
      return m_trace;
   }

   void print(void)
   {
      _Policy::print(m_trace.str());
      m_trace.str(_T(""));
   }

private:
   u_stringstream m_trace;
};

struct output
{
   static void print(const u_string s)
   {
      ::OutputDebugString(s.c_str());
   }
};

typedef trace<output> trace_dbg_t;

   }
}
